package secondkill.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import secondkill.mapper.TGoodsMapper;
import secondkill.mapper.TSeckillGoodsMapper;
import secondkill.pojo.TGoods;
import secondkill.vo.GoodsVo;
import secondkill.service.ITGoodsService;

import java.util.List;


/**
 * <p>
 *  服务实现类
 * </p>
 * @author Dzy
 * @since 2022-01-19
 */

@Service
public class TGoodsServiceImpl extends ServiceImpl<TGoodsMapper, TGoods> implements ITGoodsService {
    @Autowired
    private TGoodsMapper goodsMapper;

    @Autowired
    private TSeckillGoodsMapper secKillGoodsMapper;

/*    @Autowired
    private ITGoodsService goodsService;*/

    /**
     * 获取商品列表
     * @return java.util.List<secondkill.vo.GoodsVo> 
     * @create 2022/1/20 0:16
     */
    @Override
    public List<GoodsVo> findGoodsVoList() {
        return goodsMapper.findGoodsVo();
    }

    /**
     * 获取商品详情
     * @param goodsId
     * @return secondkill.vo.GoodsVo
     * @create 2022/1/20 12:39
     */
    @Override
    public GoodsVo findGoodsVoByGoodId(Long goodsId) {
        return goodsMapper.findGoodsVoByGoodsID(goodsId);
    }
}
